package org.geek4j.jms;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.stereotype.Component;

import lombok.extern.slf4j.Slf4j;

/**
 * @author Geek4J
 * @description ActiveMQ listener
 */
@Slf4j
@Component
public class Sender {

	@Autowired
	private JmsTemplate jmsTemplate;

	public void sendJMS(String destinationName, Object message) {
		// Send a message
		log.error("Sending a new message.");
		jmsTemplate.convertAndSend(destinationName, message);
		log.error("Sending message complete.");
	}
}